using System;
using System.Collections.Generic;
using System.Text;
using DOMercury.Interfaces;

namespace DOMercury.Items
{
    /// <summary>
    /// Represents a currently open System Window
    /// </summary>
    public class SystemWindowItem : IItem, IComparable 
    {
        private string className;
        private System.Diagnostics.Process proc;
        private string title;
        private IntPtr hnd;
        /// <summary>
        /// The System WIndow Constructor
        /// </summary>
        /// <param name="Title">The title of the System Window</param>
        /// <param name="Hwnd">The Window Handle</param>
        public SystemWindowItem(string Title, IntPtr Hwnd, System.Diagnostics.Process Process, string ClassName)
        {
            title = Title;
            hnd = Hwnd;
            proc = Process;
            className = ClassName;
        }
        #region IItem Members

        /// <summary>
        /// Returns the Title of the Window
        /// </summary>
        public string DisplayName
        {
            get { return title; }
        }

        /// <summary>
        /// Returns "system window"
        /// </summary>
        public string ItemType
        {
            get { return "system window"; }
        }

        /// <summary>
        /// returns "System Window"
        /// </summary>
        public string DisplayDesc
        {
            get { return "System Window"; }
        }

        #endregion

        /// <summary>
        /// Returns the Window Handle
        /// </summary>
        public IntPtr Hwnd
        {
            get
            {
                return hnd;
            }
        }

        /// <summary>
        /// The Window Process
        /// </summary>
        public System.Diagnostics.Process Process
        {
            get
            {
                return proc;
            }
        }

        /// <summary>
        /// The ClassName of the Window
        /// </summary>
        public string ClassName
        {
            get
            {
                return className;
            }
        }

        #region IComparable Members

        public int CompareTo(object obj)
        {
            return this.DisplayName.CompareTo(((IItem)obj).DisplayName);
        }

        #endregion
    }
}
